﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace IrisGenerator.Common.Core.UI
{
    public class IconItem
    {
        public int Index { get; set; }

        private Icon _image;
        private string _path;
        public string Path {
            get
            {
                return _path;
            }
            set
            {
                if (!value.Equals(_path))
                {
                    _path = value;
                    LoadImage();
                }
            }
        }

        private void LoadImage()
        {
            if (string.IsNullOrEmpty(_path))
            {
                _image = null;
                return;
            }
            _image = new Icon(_path);

        }

        public Icon Image {
            get
            {
                return _image;
            }
        }

        
    }
}
